/*AssistWasteInfo  废弃物管理*/
import request from "/@/utils/request";
import download from "/@/utils/download.ts";

const AssistWasteInfoApi = {

    getPageData(data: any) {
        return request({
            url: "/assistWasteInfo/pageData",
            method: "post",
            data,
        });
    },
    getDetail(data: any) {
        return request({
            url: "/assistWasteInfo/getDetail",
            method: "post",
            data,
        });
    },

    save: (data: any) => {
        return request({
            url: "/assistWasteInfo/save",
            method: "post",
            data,
        });
    },
  getWasteTypeList(){
        return request({
            url: "/sysData/listData?type=waste_type",
            method: "get",
         
        });
    },
    del: (data: any) => {
        return request({
            url: "/assistWasteInfo/del",
            method: "post",
            data,
        });
    },

    updateStatus: (data: any) => {
        return request({
            url: "/assistWasteInfo/updateStatus",
            method: "post",
            data,
        });
    },
    pageDataXls:(_searchParam: any,_xlsTitle: any) => {
                const param = new URLSearchParams();
        param.append("_searchParam",JSON.stringify(_searchParam))
        param.append("_xlsTitle",_xlsTitle)
        return request({
            url: "/assistWasteInfo/pageDataXls",
            method: "post",
            responseType: 'blob',
            headersType: 'application/json;charset=UTF-8',
                params:param,
        }).then((res)=> {
            download(res)
        });
    },
    excelImoprt: (data:any)=>{
        return request({
            url: "/assistWasteInfo/importDataXls",
            method: "post",
            headersType:'multipart/form-data',
            data,
        })
        
    },
    batchSave: (data:any)=>{
        return request({
            url: "/assistWasteInfo/batchSave",
            headersType: 'application/json;charset=UTF-8',
            method: "post",
            data,
        })
    },
};
export default AssistWasteInfoApi;
